package org.dreamwork.jasmine2.ajax;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.servlet.RequestDispatcher;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: seth
 * Date: 2009-10-19
 * Time: 14:55:20
 */
public class PageletServlet extends HttpServlet {
    @Override
    protected void service (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String pagelet = request.getServletPath ();
        int pos = pagelet.lastIndexOf ('.');
        pagelet = pagelet.substring (0, pos) + ".jscx";
        RequestDispatcher rd = request.getRequestDispatcher (pagelet);
        rd.forward (request, response);
    }
}